<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>position</title>
	<style type="text/css">
		body {
			margin: 0;
			line-height: 1.5;
			height: 2000px;
		}

		.box-position {
			position: relative;
			width: 300px;
			height: 200px;
			background: #efefef;
			left: 20px;
			top: 50px;
			padding: 10px;
		}

		.absolute-parent {
			width: 250px;
			height: 60px;
			background: green;
			color: #fff;
		}

		.box-absolute {
			position: absolute;
			bottom: 10px;
			right: 30px;
			width: 200px;
			padding: 20px;
			color: #fff;
			background: #f00;
		}

		.box-fixed {
			position: fixed;
			bottom: 10px;
			right: 30px;
			width: 200px;
			padding: 20px;
			color: #fff;
			background: blue;
		}
	</style>
</head>
<body>
	
	<div class="box-position">
		<p>这是相对定位盒子</p>
		<div class="absolute-parent">
			我是absolute元素的直接父元素，然而没有设置position
			<div class="box-absolute">我是absolute定位box</div>
		</div>
		<div class="box-fixed">我是fixed定位box</div>
	</div>
</body>
</html>

